package aecs

import (
	"fmt"

	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
)

// 云服务器 VNC 远程登录地址
func (c *Client) DescribeInstanceVncUrl(req *ecs.DescribeInstanceVncUrlRequest) (response *ecs.DescribeInstanceVncUrlResponse, err error) {
	client := c.Client
	req.Method = "GET"
	if req.Port == "" {
		req.Port = c.Port
	}

	client.DescribeInstanceVncUrl(req)
	response, err = client.DescribeInstanceVncUrl(req)

	if err != nil {
		return nil, fmt.Errorf("error DescribeInstanceVncUrl %w", err)
	}

	return response, nil
}
